package com.jhhc.RHDB.Data.Pojo;


import com.fasterxml.jackson.annotation.JsonInclude;

import java.util.ArrayList;
import java.util.List;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class NewestData {
        // 站码
        private String stcd;

        //站名
        private String stnm;

        @Override
        public String toString() {
                return "NewestData{" +
                        "stcd='" + stcd + '\'' +
                        ", stnm='" + stnm + '\'' +
                        ", sensors=" + sensors +
                        '}';
        }

        // 传感器数据
        private List<Sensors_NewsData> sensors;

        public String getStcd() {
                return stcd;
        }

        public void setStcd(String stcd) {
                this.stcd = stcd;
        }

        public String getStnm() {
                return stnm;
        }

        public void setStnm(String stnm) {
                this.stnm = stnm;
        }

        public List<Sensors_NewsData> getSensors() {
                return sensors;
        }


        List<Sensors_NewsData> sensors1_NewsData = new ArrayList<>();
        public void setSensors(Sensors_NewsData sensors) {
                this.sensors = sensors1_NewsData;
                sensors1_NewsData.add(sensors);
        }



        public Sensors_NewsData getSensor(String sensor_T) {
                System.out.println(sensor_T);
                //Sensors sensors=null;
                if (sensors!=null) {
                        System.out.println("sensors"+sensors);
                        for (int i = 0; i < sensors.size(); i++) {
                                if (sensors.get(i).getSensorType().toString().equals(sensor_T)) {
                                        return sensors.get(i);
                                }

                        }
                }
                return null;


        }
}
